home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 051-075 / scopedisk55 / galaxy / galaxy.doc < prev    next >
Text File  |  1995-03-19  |  3KB  |  47 lines

  1.             GALAXY by Steve Riley
  2.  
  3. This program was taken from an algorithm in December 1988 Astronomy
  4. magazine.  They had a BASIC program listing from which I translated
  5. it to C and made some modifications to the display sequence, fixed
  6. a bug, etc.  This program is placed in the public domain, but is not
  7. to be sold for a profit.
  8.  
  9. This program represents the collision of two galaxys.  The main galaxy
  10. initially starts a rest with respect to the screen and has stars, each of
  11. which represent a few million stars in a real galaxy.  This is called an
  12. N body representation, since we don't have the computing power, memory, or
  13. time to represent each of 100 billion stars on the screen.  The number of
  14. stars on the screen will determine how long it takes to compute each frame.
  15. 250 stars takes approx 10 seconds per frame.  Use less when trying new start
  16. sequences, more when you have a good sequence you want to see a lot of detail
  17. on.  The limit is 32700 stars, be careful however, about 54K of RAM is
  18. allocated for each 100 stars.  I tried it with 22,000 stars and over 1MB of
  19. my RAM was used!  The intruder galaxy is represented by its "core" and does
  20. not have any "stars" associatted with it (unless it captures some from the
  21. main galaxy).
  22.  
  23. The program starts by asking several questions.  The first two questions
  24. have to do with the number of stars to be displayed.  The stars are
  25. initially displayed in rings around the main galaxy core.  You pick the
  26. number of rings and the number of stars per ring.
  27.  
  28. Next pick the mass of the intruder galaxy as a percentage of the main
  29. galaxy.  1 would be the same mass, .5 half the mass, 2 twice the mass, etc.
  30.  
  31. Next choose the starting position of the intruder galaxy.  This is done in
  32. terms of the screen resolution, you can go +- 160 in the X direction
  33. (left & right), and +- 70 in the Y and Z directions.  The left side
  34. of the screen is a top view (X,Y), the right side a side view (X,Z).
  35.  
  36. The next question is the intruder velocity in X,Y,Z, you probably don't
  37. want to pick anything over +- 5.
  38.  
  39. I have tried many different scenerios, and have had some strange and
  40. interesting results.  I have tried picking some wild numbers and have
  41. not had any problems with floating point overflows or divide by zeros
  42. or anything, but you are on your own.  This programs does use the Amiga
  43. IEEE floating point package, thus supposedly supports a 68881 floating
  44. point processor which should hopefully speed things up by about 10
  45. times!  I was not able to try this out.  All calculations are done in
  46. double precision floating point.
  47.